import React, { Component } from 'react'

export default class CartItem extends Component {
  render() {
    const { product } = this.props;
    return (
      <div style={{margin: '20px 0'}}>
      {product.title} - {product.price} - {product.quantity}
      <button style={{marginLeft: '20px'}} onClick={this.props.onRemoveItem}>移除购物车</button>
    </div>
    )
  }
}
